<html>
<head>
<script type="text/javascript" src="<?php echo base_url()?>js/jquery.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>js/jquery-ui.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>js/jquery.timeago.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	 jQuery(".time").timeago();
	 jQuery(".time2").timeago();
	 
	$('.delete_comment_placelist<?php echo $add;?>').click(function() 
	{
		var item = $(this);
		var $konfirmasi = $("<div></div>" )
			.html('Are you sure want to delete this comment?')
			.dialog({
				title: 'Delete Comment Place',
				autoOpen: false,
				resizable: false,
				height:140,
				modal: true,
				buttons: {
					"Yes": function() {
						$.ajax({
							type: "POST",
							url: "http://localhost/ta/place/del_com",
							data: $.param({id_comment:item.attr("del_id")}),
							cache: false,
							success: function(html){
								//alert('aa'+item.attr("del_id")+item.attr("cat"));
								$(".row_com_"+item.attr("del_id")).slideUp('slow', function() {$(this).remove();});
							}
						});
						$( this ).dialog( "close" );
					},
					"No": function() {
						$( this ).dialog( "close" );
					}
				}
			});	
		$konfirmasi.dialog('open');
		return false;
	});
	
	
	
});
</script>
</head>
<body>
			
			<div class='panelcomment' id="slidepanelcomment<?php echo $idpage; ?>">
			<ol style="list-style-type:none" id="update_comment_place<?php echo $idpost; ?>" class="timeline_comment">
			<div class="kotakstatus2">

				<?php foreach($comments_post as $komen):?>
					<li style="list-style-type:none" class="row_com_<?php echo $komen->id_comment;?>">
						<?php if($idpost == $komen->id_place){
							echo '<div class="comment_status">';
							echo '<div class="photo3">';
							if ($komen->avatar == 0 || $komen->avatar == null){
								if ($komen->id_user == $this->session->userdata('id_user')){
									echo anchor('profile',img($def2));
								}else{
									echo anchor('people/view/'.$komen->id_user,img($def2));
								} 
							}else {
								if ($komen->id_user == $this->session->userdata('id_user')){
									echo anchor('profile',img(array('src'=>'img/thumb_foto/'.$komen->filename,'width'=>30,'height'=>30)));
								}else{
									echo anchor('people/view/'.$komen->id_user,img(array('src'=>'img/thumb_foto/'.$komen->filename,'width'=>30,'height'=>30)));
								}
							}
							echo '</div>';
							if ($komen->id_user == $this->session->userdata('id_user')){
								echo '<div class="username2"><b>'.anchor('profile',$komen->username).'</b></div>';
								echo '<div class="status3">'.$komen->content.'</div>';
								echo '<div class="time2" title="'.$komen->created.'"></div>';
								echo '<div class="action"><a href="#"  del_id="'.$komen->id_comment.'"  class="delete_comment_placelist'.$add.'" ><img src="http://localhost/ta/img/delete.gif"/>Delete</a></div>';
							}else{
								echo '<div class="username2"><b>'.anchor('people/view/'.$komen->id_user,$komen->username).'</b></div>';
								echo '<div class="status3">'.$komen->content.'</div>';
								echo '<div class="time2" title="'.$komen->created.'"></div>';
							}
							echo '</div>';
						}?>
					</li>	
				<?php endforeach;?>		
				
			</div>
			</ol>
			</div>
				
				
</body>
</html>